<template>
  <el-dialog
    append-to-body
    :title="title"
    center
    :visible.sync="openState"
    width="1024px"
    :close-on-click-modal="false"
  >
    <el-form ref="queryDetail" :model="form" label-width="110px">
      <!--交易础信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>交易基础信息</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="交易流水号" prop="id">
              <el-input v-model="form.id" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="CPG日期" prop="cpgdate">
              <el-date-picker v-model="form.cpgdate" style="width: 100%" type="date" value-format="yyyyMMdd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工作日期" prop="workdate">
              <el-date-picker v-model="form.workdate" style="width: 100%" type="date" value-format="yyyyMMdd" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="业务优先级" prop="bizPriority">
              <el-select style="width: 100%;" v-model="form.bizPriority" placeholder="业务优先级" disabled>
                <el-option
                  v-for="dict in dictMap.PRIORITY3CODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="交易渠道" prop="source">
              <el-select style="width: 100%;" v-model="form.source" placeholder="柜面交易" disabled>
                <el-option
                  v-for="dict in dictMap.TXN_SOURCE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="记账标识" prop="cbflag">
              <el-select style="width: 100%" v-model="form.cbflag" placeholder="记账标识" disabled>
                <el-option
                  v-for="dict in dictMap.CBFLAG"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="账户类型" prop="custflag1">
              <el-select style="width: 100%" v-model="form.custflag1" placeholder="账户类型" disabled>
                <el-option
                  v-for="dict in dictMap.CUST_FLAG1"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="业务类型" prop="bizTypeCode">
              <el-select
                style="width: 100%"
                v-model="
                  form.bizTypeCode === null || form.bizTypeCode === undefined
                    ? ''
                    : form.bizTypeCode + '-' + form.bizTypeCodeDesc
                "
                placeholder="业务类型"
                :disabled="true"
              ></el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select
                style="width: 100%"
                v-model="
                  form.bizCtgyCode === null || form.bizCtgyCode === undefined
                    ? ''
                    : form.bizCtgyCode + '-' + form.bizCtgyCodeDesc
                "
                placeholder="业务种类"
                :disabled="true"
              ></el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="交易币种" prop="curcd">
              <el-input v-model="form.curcd" placeholder="货币种类" :disabled="true"   disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="金额" prop="amount">
              <ht-amount-input v-model="form.amount" placeholder="交易金额"  :disable="true"></ht-amount-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="大写金额" prop="bAmount">
              <ht-amount-upper :inputValue="form.amount" placeholder="交易金额" ></ht-amount-upper>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="手续费金额" prop="feeAmount">
              <el-tooltip :content="form.feeAmountRemarks" placement="top-start"  :disabled="form.feeAmountRemarks===''||form.feeAmountRemarks===null||form.feeAmountRemarks===undefined">
                <ht-amount-input
                  v-model="form.feeAmount"
                  placeholder="手续费金额"
                  :disable="true"
                ></ht-amount-input>
              </el-tooltip>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="备注" prop="remarks">
                <el-input type="textarea" v-model="form.remarks" disabled/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-row>
      </el-card>

      <!--付款人信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <el-input v-model="form.payerActno" placeholder="付款人账号" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="付款行行号" prop="payerBrno">
              <el-input v-model="form.payerBrno" placeholder="付款行行号" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="付款人名称" prop="payerName">
            <el-input v-model="form.payerName" placeholder="付款人名称" disabled/>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="付款人地址" prop="payerAddr">
            <el-input v-model="form.payerAddr" placeholder="付款人地址" disabled/>
          </el-form-item>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款人开户行号" prop="payerAccBrno">
                <el-input v-model="form.payerAccBrno" placeholder="付款人开户行行号" disabled/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="付款人开户行行名" prop="payerAccBrname" label-width="130px">
              <el-input v-model="form.payerAccBrname" placeholder="付款人开户行行名" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--收款人信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="收款人账号" prop="payeeActno">
              <el-input v-model="form.payeeActno" placeholder="收款人账号" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收款行行号" prop="payeeBrno">
              <el-input v-model="form.payeeBrno" placeholder="收款行行号" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="收款人名称" prop="payeeName">
          <el-input v-model="form.payeeName" placeholder="收款人名称" disabled/>
        </el-form-item>
        <el-form-item label="收款人地址" prop="payeeAddr">
          <el-input v-model="form.payeeAddr" placeholder="收款人地址" disabled/>
        </el-form-item>
        <el-row :gutter="10"></el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款人开户行号" prop="payeeAccBrno">
                <el-input v-model="form.payeeAccBrno" placeholder="收款人开户行行号" disabled/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="收款人开户行行名" prop="payeeAccBrname" label-width="130px">
              <el-input v-model="form.payeeAccBrname" placeholder="收款人开户行行名" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>中介信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="中介机构1" prop="agency1">
                <el-input v-model="form.agency1" placeholder="中介机构1" disabled/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="中介机构1名称" prop="agency1name" label-width="130px">
              <el-input v-model="form.agency1name" placeholder="中介机构1名称" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="中介机构2" prop="agency2">
                <el-input v-model="form.agency2" placeholder="中介机构2" disabled/>
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="中介机构2名称" prop="agency2name" label-width="130px">
              <el-input v-model="form.agency2name" placeholder="中介机构2名称" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>其他信息</span>
        </div>

        <el-row>
          <el-col :span="12">
            <el-form-item label="录入操作员" prop="mdTlrno">
              <el-input v-model="form.mdTlrno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="录入时间" prop="mdTime">
              <el-date-picker
                style="width: 100%"
                v-model="form.mdTime"
                value-format="yyyyMMddHHmmss"
                type="datetime"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="附言" prop="memo">
                <el-input type="textarea" v-model="form.memo" disabled/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="复核操作员" prop="ckTlrno">
              <el-input v-model="form.ckTlrno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="复核时间" prop="ckTime">
              <el-date-picker
                style="width: 100%"
                v-model="form.ckTime"
                value-format="yyyyMMddHHmmss"
                type="datetime"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="复核附言" prop="ckRemarks">
              <el-input type="textarea" v-model="form.ckRemarks" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="审核操作员" prop="audTlrno">
              <el-input v-model="form.audTlrno" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="审核时间" prop="audTime">
              <el-date-picker
                style="width: 100%"
                v-model="form.audTime"
                value-format="yyyyMMddHHmmss"
                type="datetime"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="审核附言" prop="audRemarks">
              <el-input type="textarea" v-model="form.audRemarks" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="授权附言" prop="authRemarks">
              <el-input type="textarea" v-model="form.authRemarks" maxlength="128" show-word-limit/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card" v-show="this.form.bizTypeCode==='A109'">
        <div slot="header" class="label-header-msg">
          <span>委托收款 （划回）</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="票据日期" prop="clltnNotesDate">
              <el-date-picker v-model="form.clltnNotesDate" style="width: 100%;" type="date" value-format="yyyyMMdd" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="凭证种类" prop="clltnNotesType">
              <el-select style="width: 100%;" v-model="form.clltnNotesType" placeholder="凭证种类" disabled>
                <el-option
                  v-for="dict in dictMap.CLLTN_NOTES_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="票据号码" prop="e2eId">
              <el-input v-model="form.e2eId" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card" v-show="this.form.bizTypeCode==='A110'">
        <div slot="header" class="label-header-msg">
          <span>托收承付（划回）</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="票据号码" prop="e2eId">
              <el-input v-model="form.e2eId" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="票据日期" prop="pmtNotesDate">
              <el-date-picker v-model="form.pmtNotesDate" style="width: 100%;" type="date" value-format="yyyyMMdd" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="赔偿金额币种" prop="pmtAmendsCurcd">
              <el-input v-model="form.pmtAmendsCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="赔偿金额" prop="pmtAmendsAmount">
              <ht-amount-input
                v-model="form.pmtAmendsAmount"
                placeholder="赔偿金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="拒付金额币种" prop="pmtRejectCurcd">
              <el-input v-model="form.pmtRejectCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="拒付金额" prop="pmtRejectAmount">
              <ht-amount-input
                v-model="form.pmtRejectAmount"
                placeholder="赔偿金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="原托金额币种" prop="pmtOriCurcd">
              <el-input v-model="form.pmtOriCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="原托金额" prop="pmtOriAmount">
              <ht-amount-input
                v-model="form.pmtOriAmount"
                placeholder="赔偿金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="12">
            <el-form-item label="支付金额币种" prop="pmtPayCurcd">
              <el-input v-model="form.pmtPayCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="支付金额" prop="pmtPayAmount">
              <ht-amount-input
                v-model="form.pmtPayAmount"
                placeholder="赔偿金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="多付金额币种" prop="pmtAddCurcd">
              <el-input v-model="form.pmtAddCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="多付金额" prop="pmtAddAmount">
              <ht-amount-input
                v-model="form.pmtAddAmount"
                placeholder="赔偿金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card" v-show="this.form.bizTypeCode==='A201'">
        <div slot="header" class="label-header-msg">
          <span>支票</span>
        </div>

        <el-row>
          <el-col :span="12">
            <el-form-item label="票据号码" prop="e2eId">
              <el-input v-model="form.e2eId" disabled/>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="出票日期" prop="checkNotesDate">
              <el-date-picker v-model="form.checkNotesDate" style="width: 100%;" type="date" value-format="yyyyMMdd" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="出票人名称" prop="checkAppName">
              <el-input v-model="form.checkAppName" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="票据张数" prop="checkNotesNum">
              <el-input v-model="form.checkNotesNum" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="票据金额币种" prop="checkNotesCurcd">
              <el-input v-model="form.checkNotesCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="票据金额" prop="checkNotesAmount">
              <ht-amount-input
                v-model="form.checkNotesAmount"
                placeholder="票据金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="牌价币种" prop="checkExchageCurcd">
              <el-input v-model="form.checkExchageCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="牌价" prop="checkExchage">
              <ht-amount-input
                v-model="form.checkExchage"
                placeholder="票据金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card" v-show="this.form.bizTypeCode==='A202'&& this.form.bizCtgyCode==='02901'">
        <div slot="header" class="label-header-msg">
          <span>城市商业银行汇票资金移存</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="票据号码" prop="e2eId">
              <el-input v-model="form.e2eId" disabled/>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="出票日期" prop="dftDate">
              <el-date-picker v-model="form.dftDate" style="width: 100%;" type="date" value-format="yyyyMMdd" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="汇票密押" prop="dftKey">
              <el-input v-model="form.dftKey" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="票据种类" prop="dftCtgy">
              <el-select style="width: 100%;" v-model="form.dftCtgy" placeholder="票据种类" disabled>
                <el-option
                  v-for="dict in dictMap.DFT_CTGY"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="现金汇票兑付行" prop="dftPayBrno">
              <el-input v-model="form.dftPayBrno" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="票面记载汇票收款人名称" prop="dftPayerName">
              <el-input v-model="form.dftPayerName" disabled/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>


      <el-card class="form-card" v-show="this.form.bizTypeCode==='A111'||this.form.bizTypeCode==='A203'||this.form.bizTypeCode==='A204'">
        <div slot="header" class="label-header-msg" v-show="this.form.bizTypeCode==='A111'">
          <span>商业汇票附加域信息</span>
        </div>
        <div slot="header" class="label-header-msg" v-show="this.form.bizTypeCode==='A203'||this.form.bizTypeCode==='A204'">
          <span>银行本票附加域信息</span>
        </div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="票据号码" prop="e2eId">
              <el-input v-model="form.e2eId" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="12" v-show="this.form.bizTypeCode==='A203'">
            <el-form-item label="票据种类" prop="dftCtgy">
              <el-select style="width: 100%;" v-model="form.dftCtgy" placeholder="票据种类" disabled>
                <el-option
                  v-for="dict in dictMap.DFT_CTGY"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-show="this.form.bizTypeCode==='A204'">
            <el-form-item label="票据种类" prop="dftCtgy">
              <el-select style="width: 100%;" v-model="form.dftCtgy" placeholder="票据种类" disabled>
                <el-option
                  v-for="dict in dictMap.BANK_NOTE_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="出票日期" prop="dftDate">
              <el-date-picker v-model="form.dftDate" style="width: 100%;" type="date" value-format="yyyyMMdd" disabled/>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="申请人账号" prop="dftAppActno">
              <el-input v-model="form.dftAppActno" disabled/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="12">
            <el-form-item label="申请人名称" prop="dftAppName">
              <el-input v-model="form.dftAppName" disabled/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="出票货币" prop="dftCurcd">
              <el-input v-model="form.dftCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出票金额" prop="dftAmount">
              <ht-amount-input
                v-model="form.dftAmount"
                placeholder="出票金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="实际结算金额货币" prop="dftStCurcd">
              <el-input v-model="form.dftStCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="实际结算金额" prop="dftStAmt">
              <ht-amount-input
                v-model="form.dftStAmt"
                placeholder="实际结算金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="多余金额货币" prop="dftOverCurcd">
              <el-input v-model="form.dftOverCurcd" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="多余金额" prop="dftOverAmt">
              <ht-amount-input
                v-model="form.dftOverAmt"
                placeholder="出票金额"
                :disable=true
              ></ht-amount-input>
            </el-form-item>
          </el-col>
        </el-row>


      </el-card>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="authorize">授权</el-button>
      <el-button type="danger" @click="reject">拒绝</el-button>
      <el-button @click="handleClose">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import HtAmountInput from "@/views/components/HtAmountInput";
import HtAmountUpper from "@/views/components/HtAmountUpper";
import { detail, authorize, reject } from "@/api/cnaps/baseBiz/send/auth";

export default {
  name: "detail111",
  components: {
    HtAmountInput,
    HtAmountUpper,
  },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      busTypeList: [],
      id: "",
      pkgNo: "",
      title: "",
      // 是否显示弹出层
      openState: false,
      // 表单参数
      form: {
        amount: "0.00",
      },
    };
  },
  mounted() {},
  methods: {
    // 关闭回掉
    handleClose() {
      this.openState = false;
    },
    show(id, pkgtype) {
      this.openState = true;
      this.id=id;
      if (id) {
        this.title = "大额汇兑业务授权";
        detail({
          id: id,
          pkgtype: pkgtype,
        }).then((res) => {
          this.$set(this, "form", res.result.data);
        });
      }
    },

    /** TODO提交按钮 */
    authorize: function () {
      let form = this.form;
      console.log("form", form);
      //如果有ID 则是修改
      if (this.id) {
        form.id = this.id;
        authorize(form, "6501").then((res) => {
          this.msgSuccess("授权成功");
          this.$emit("editComplete", true);
          this.openState = false;
        });
      }
    },
    reject() {
      let form = this.form;
      form.id = this.id;
      reject(form, "6501").then((res) => {
        this.msgSuccess("拒绝成功");
        this.$emit("editComplete", true);
        this.openState = false;
      });
    },

  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
